import request from '@/request'
const URL = process.env.VUE_APP_API

// 参数列表
export function getParaList(params) {
  return request({
    url: `${URL}/manage/upmsParam/list`,
    method: 'get',
    params
  })
}

// 参数详情
export function getParaInfo(id) {
  return request({
    url: `${URL}/manage/upmsParam/info/${id}`,
    method: 'get'
  })
}

// 新增参数
export function addPara(data) {
  return request({
    url: `${URL}/manage/upmsParam/add`,
    method: 'post',
    data
  })
}

// 修改参数
export function updatePara(id, data) {
  return request({
    url: `${URL}/manage/upmsParam/update/${id}`,
    method: 'post',
    data
  })
}

// 删除参数
export function paraDelete(ids) {
  return request({
    url: `${URL}/manage/upmsParam/delete/${ids}`,
    method: 'get'
  })
}

// 通过当前用户所在组织,paramKey查询参数配置
export function getByParamKey(params) {
  return request({
    url: `${URL}/manage/upmsParam/getByParamKey`,
    method: 'get',
    params
  })
}
